package PTA;

import java.util.Scanner;
interface Fruit{
    void eat();
}
class Apple implements  Fruit {
    @Override
    public void eat() {
        System.out.println("吃苹果啦啦啦！！");
    }
}
class Orange implements  Fruit {
    @Override
    public void eat() {
        System.out.println("吃橘子啦啦啦！！");
    }
}
class Factory5 {
    public static Fruit getInstance(String name) {
        if(name.equals("apple"))
            return new Apple();
        if(name.equals("orange"))
            return new Orange();
        else
            return null;
    }
}
public class t5 {
    public static void main(String[] args) {
    String s;
    Scanner scan=new Scanner(System.in);
    s=scan.next();
    Fruit f= Factory5.getInstance(s);
    if(f==null)
        System.out.println("没有此水果类型");
    else
        f.eat();
}
}
